﻿using System;

namespace SharePointUtilitiesForDevelopers.Action
{
    /// <summary>
    /// An attribute that describes an action class.
    /// </summary>
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
    public sealed class ActionAttribute: Attribute
    {
        private readonly string _title;
        private readonly string _description;
        private readonly ActionTarget _target;

        /// <summary>
        /// Initializes a new instance of the <see cref="ActionAttribute"/> class.
        /// </summary>
        /// <param name="title">The title.</param>
        /// <param name="description">The description.</param>
        /// <param name="target">The target.</param>
        public ActionAttribute(string title, string description, ActionTarget target)
        {
            _title = title;
            _description = description;
            _target = target;
        }

        /// <summary>
        /// Gets the title.
        /// </summary>
        /// <value>The title.</value>
        public string Title
        {
            get { return _title; }
        }

        /// <summary>
        /// Gets the description.
        /// </summary>
        /// <value>The description.</value>
        public string Description
        {
            get { return _description; }
        }

        /// <summary>
        /// Gets the targets.
        /// </summary>
        /// <value>The targets.</value>
        public ActionTarget Target
        {
            get { return _target; }
        }
    }
}
